package fr.ifisher.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HomeController {

	// private final Logger LOGGER =
	// LoggerFactory.getLogger(HomeController.class);

	@RequestMapping(value = "/home/create")
	public String create(ModelMap model) {
		return "wizard/create";
	}

	@RequestMapping(value = "/home/createProject")
	public ModelAndView createProject(HttpServletRequest request,
			HttpServletResponse response) {

		String projectName = request.getParameter("projectName");
		String presentation = request.getParameter("presentation");

		ModelAndView model = new ModelAndView("project/main");

		model.addObject("projectName", projectName);
		model.addObject("presentation", presentation);

		return model;
	}

	@RequestMapping(value = "/home/getProject")
	public String getProject(ModelMap model) {
		return "project/indexProject";
	}

}
